package cn.tkb.basic.util;

import lombok.Data;

@Data
public class AjaxResult {
    private Boolean success = true;
    private String msg="操作成功";
    private Object resultObj;
    //设置成功返回的Ajax对象
    public static AjaxResult success(){
        return  new AjaxResult();
    }
    public static AjaxResult fail(String msg){
        return success().setSuccess(false).setMsg(msg);
    }

    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}
